<!DOCTYPE html>
<html>

	<head>
		<meta charset="utf-8">
		<title>layui</title>
		<meta name="renderer" content="webkit">
		<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
		<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
		<link rel="stylesheet" href="__PUBLIC__/layui/css/layui.css" media="all">
		<link rel="stylesheet" href="__PUBLIC__/font-awesome/css/font-awesome.min.css" media="all" />
		<link rel="stylesheet" href="__CSS__/admin.css" media="all">
		<style type="text/css">
			/* tooltip */
			#tooltip {
				position: absolute;
				border: 1px solid #ccc;
				background: #333;
				padding: 2px;
				display: none;
				color: #fff;
			}
		</style>
	</head>

	<body style="padding:10px;">
		<div style="float: right;margin-right:5%;"><button onclick="add_type()" class="layui-btn layui-btn-normal layui-btn-sm">+新增分类</button></div>
		<div class="tplay-body-div">
			<div class="layui-tab">
				<ul class="layui-tab-title">
					<li class="layui-this">菜品分类</li>
					<li>
						<a href="{:url('admin/dinner/caipin')}" class="a_menu">菜品管理</a>
					</li>
				</ul>
			</div>
			<table class="layui-table" lay-size="sm">
				<thead>
					<tr>
						<th>分类名称</th>
						<th>排序</th>
						<th>操作</th>
					</tr>
				</thead>
				<tbody>
					{volist name="list" id="vo"}
					<tr>
						<td>{$vo.name}</td>
						<td>{$vo.sort}</td>
						<td class="operation-menu">
							<div class="layui-btn-group">
								<a href="javascript:edit_type({$vo.id})" class="layui-btn layui-btn-xs a_menu layui-btn-primary" id="{$vo.id}" style="margin-right: 0;font-size:12px;"><i class="layui-icon"></i></a>
								<!--<a class="layui-btn layui-btn-xs layui-btn-primary delete" id="{$vo.id}" style="margin-right: 0;font-size:12px;"><i class="layui-icon"></i></a>-->
							</div>
						</td>
					</tr>
					{/volist}
				</tbody>
			</table>

			{include file="public/foot"}

			<script type="text/javascript">
				
				function add_type(){
			  		layer.open({
							type: 2,
							title: '新增菜品分类',
							shadeClose: true,
							shade: 0.8,
							area: ['560px', '420px'],
							content: ["{:url('admin/dinner/add_caipin_type')}"]
						});
			  	}
				function edit_type(id){
					var url="/admin/dinner/add_caipin_type?id="+id;
					layer.open({
							type: 2,
							title: '新增菜品分类',
							shadeClose: true,
							shade: 0.8,
							area: ['560px', '420px'],
							content: [url]
						});
				}
			</script>
		</div>
	</body>

</html>